using System;
using System.Collections.Generic;
using System.Text;
using Zsa.Emulation.Render;
using System.Runtime.Serialization;
using Zsa.Emulation.Render.Video;
using System.IO.IsolatedStorage;
using Zsa.Emulation.Render.Audio;
using Zsa.Emulation.Render.Input;

namespace Zsa.Emulation.Config
{
    /// <summary>
    /// Nes configuration profile.  
    /// Includes render and machine settings.
    /// </summary>
    [Serializable()]
    public class NesConfigurationProfile : ICloneable
    {
        #region Fields
        /// <summary>
        /// The name of the profile.
        /// </summary>
        private string _Name;


        /// <summary>
        /// The render settings.
        /// </summary>
        private RenderSettings _RenderSettings;

        /// <summary>
        /// The machine settings.
        /// </summary>
        private NesMachineSettings _MachineSettings;

        #endregion Fields

        #region Constructor
        /// <summary>
        /// Initializes a new instance of the <see cref="T:NesConfigurationProfile"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="machineSettings">The machine settings.</param>
        internal NesConfigurationProfile(string name,
            NesMachineSettings machineSettings)
        {
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="T:NesConfigurationProfile"/> class.
        /// </summary>
        internal NesConfigurationProfile(string name,
            NesMachineSettings machineSettings, RenderSettings renderSettings)
        {
            _Name = name;
            _MachineSettings = machineSettings;
            _RenderSettings = renderSettings;
            
        }
        #endregion Constructor

        #region Properties
        /// <summary>
        /// Gets the name.
        /// </summary>
        /// <value>The name.</value>
        public string Name
        {
            get
            {
                return _Name;
            }
        }

        /// <summary>
        /// Gets the machine settings.
        /// </summary>
        /// <value>The machine settings.</value>
        public NesMachineSettings MachineSettings
        {
            get
            {
                return _MachineSettings;
            }
        }

        /// <summary>
        /// Gets or sets the graphics settings.
        /// </summary>
        /// <value>The graphics settings.</value>
        public GraphicRenderSettings GraphicsSettings
        {
            get
            {
                return _RenderSettings.GraphicsSettings;
            }
        }

        /// <summary>
        /// Gets or sets the audio settings.
        /// </summary>
        /// <value>The audio settings.</value>
        public SoundDeviceSettings AudioSettings
        {
            get
            {
                return _RenderSettings.AudioSettings;
            }
        }
        
        /// <summary>
        /// Gets or sets the input settings.
        /// </summary>
        /// <value>The input settings.</value>
        public ControllerSettings InputSettings
        {
            get
            {
                return _RenderSettings.InputSettings;
            }
        }

        /// <summary>
        /// Gets the settings.
        /// </summary>
        /// <value>The settings.</value>
        internal RenderSettings Settings
        {
            get
            {
                return _RenderSettings;
            }
        }
        #endregion Properties




        #region Methods
        /// <summary>
        /// Clones this instance.
        /// </summary>
        /// <returns></returns>
        public NesConfigurationProfile Clone()
        {
            throw new Exception("The method or operation is not implemented.");
        }
        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        object ICloneable.Clone()
        {
            return this.Clone();
        }

        #endregion Methods
    }
}
